/*
 * crc.h
 *
 *  Created on: Oct 16, 2013
 *      Author: Ken Arok
 */

#ifndef CRC_H_
#define CRC_H_

#include "compiler.h"

/** \brief Calculates the CRC7.
 *
 * @param _buf	Buffer data to be computed.
 * @param _size	Size of buffer data.
 * @return Result.
 */
extern uint8_t vCompute_CRC7(uint8_t *_buf, uint8_t _size);

/** \brief Update CRC CCITT Kermit.
 *
 * @param _crc	Previous CRC value.
 * @param _data	New Data to be compute.
 * @return Result.
 */
extern uint16_t vUpdate_CRC_CCITT_Kermit(uint16_t _crc, uint8_t _data);

/** \brief Compute the CRC CCITT Kermit.
 *
 * @param _length	Length of buffer to be computed.
 * @param _buf		Buffer data to be computed.
 * @return Result.
 */
extern uint16_t vCompute_CRC_CCITT_Kermit(uint16_t _length, uint8_t *_buf);

#endif /* CRC_H_ */
